<?php
class Category extends Controller {
	public function html() {
		$p = $this->get('p', 'int', 11);//省份
		$c = $this->get('c', 'int');//城市
		$s = $this->get('s', 'int');//类型
		$d = $this->get('d', 'int');//排序
		
		$page = $this->get('page', 'int', 1);
		
		//城市
		$data['province'] = array(
			34 => '安徽',
			11 => '北京',
			50 => '重庆',
			35 => '福建',
			62 => '甘肃',
			44 => '广东',
			45 => '广西',
			52 => '贵州',
			46 => '海南',
			13 => '河北',
			23 => '黑龙江',
			41 => '河南'
		);
		
		$mProduct = new Product_model();
		$params = array(
			'status' => 1 //上架景点
		);
		if($p) $params['province'] = $p;
		if($c) $params['city'] = $c;
		if($s) $params['cid'] = $s;
		$data['product'] = $mProduct->page($page, 20, $params);
		
		//获取分类
		$data['category'] = $mProduct->category();
		
		$tpl = 'category.html';
		$this->display($data, $tpl);
	}
}